//
//  CZBKGuideController.m
//  CZ彩票
//
//  Created by apple on 15/8/28.
//  Copyright (c) 2015年 apple. All rights reserved.
//

#import "GuideController.h"
#import "GuideCell.h"
#import "UIView+Ext.h"
#define CZBKGuideCellCount 3

@interface GuideController ()
@property (nonatomic, weak) UIImageView* imgViewIcon;
@property (nonatomic, weak) UIImageView* imgViewLarge;
@property (nonatomic, weak) UIImageView* imgViewSmall;

@end

@implementation GuideController

static NSString* const reuseIdentifier = @"guide_cell";

- (void)viewDidLoad
{
    [super viewDidLoad];

    [self.collectionView registerClass:[GuideCell class] forCellWithReuseIdentifier:reuseIdentifier];
    self.collectionView.showsHorizontalScrollIndicator = NO;
    self.collectionView.bounces = NO;
    self.collectionView.pagingEnabled = YES;


}
- (instancetype)init
{

    UICollectionViewFlowLayout* flowLayout = [[UICollectionViewFlowLayout alloc] init];
    flowLayout.itemSize = [UIScreen mainScreen].bounds.size;
    flowLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
    flowLayout.minimumLineSpacing = 0;

    return [super initWithCollectionViewLayout:flowLayout];
}

- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView*)collectionView
{
    return 1;
}

- (NSInteger)collectionView:(UICollectionView*)collectionView numberOfItemsInSection:(NSInteger)section
{
    return 3;
}

- (UICollectionViewCell*)collectionView:(UICollectionView*)collectionView cellForItemAtIndexPath:(NSIndexPath*)indexPath
{

    GuideCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:reuseIdentifier forIndexPath:indexPath];

    if(indexPath.row == 0) {
        cell.image = [UIImage imageNamed:@"启动页1"];
    } else if (indexPath.row == 1) {
        cell.image = [UIImage imageNamed:@"启动页2"];
    } else {
        cell.image = [UIImage imageNamed:@"启动页3"];
    }

//    cell.image = [UIImage imageNamed:[NSString stringWithFormat:@"启动页%ld.jpg",indexPath.row]];
    
    [cell setStartButtonVisibleWithIndex:(int)indexPath.row count:CZBKGuideCellCount];

    return cell;


}



@end
